/* B站官方配色方案 */
:root {
    /* B站主题色 */
    --bilibili-blue: #00A1D6;
    --bilibili-pink: #FB7299;
    --bilibili-blue-dark: #00aff6;
    --bilibili-blue-darker: #0089b8;
    
    /* 功能色 */
    --success-color: #52c41a;
    --error-color: #ff6b81;
    --warning-color: #faad14;
    --info-color: #1890ff;
    
    /* 背景和文字 */
    --bg-gradient-start: #0088cc;
    --bg-gradient-end: #ff4b7a;
    --bg-light: #f4f5f7;
    --card-bg: #ffffff;
    --text-primary: #18191c;
    --text-secondary: #61666d;
    --text-light: #9499a0;
    --border-color: #e3e5e7;
    
    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);
    
    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    /* 过渡 */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, 
                 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ================ 头部样式 ================ */
.header {
    text-align: center;
    padding: 50px 20px 40px;
    color: white;
    animation: fadeInDown 0.8s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
}

.bilibili-logo {
    width: 64px;
    height: 64px;
    color: white;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

.logo h1 {
    font-size: 42px;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 18px;
    opacity: 0.95;
    margin-top: 10px;
    font-weight: 500;
}

/* ================ 主内容区 ================ */
.main-content {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 50px;
    box-shadow: var(--shadow-xl);
    margin-bottom: 30px;
    animation: fadeInUp 0.8s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================ 输入区域 ================ */
.input-section {
    margin-bottom: 40px;
}

.input-container {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.input-wrapper {
    flex: 1;
    position: relative;
}

.input-icon {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bilibili-blue);
    font-size: 20px;
    z-index: 1;
}

.video-input {
    width: 100%;
    padding: 20px 24px 20px 60px;
    border: 3px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 16px;
    transition: var(--transition);
    outline: none;
    background: white;
}

.video-input:focus {
    border-color: var(--bilibili-blue);
    box-shadow: 0 0 0 4px rgba(0, 161, 214, 0.15);
}

.video-input::placeholder {
    color: var(--text-light);
}

.analyze-btn {
    padding: 20px 48px;
    background: linear-gradient(135deg, var(--bilibili-blue), var(--bilibili-pink));
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    box-shadow: var(--shadow-md);
}

.analyze-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.analyze-btn:active {
    transform: translateY(-1px);
}

.analyze-btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
}

.example-links {
    display: flex;
    gap: 20px;
    align-items: center;
    font-size: 15px;
}

.example-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.example-link {
    color: var(--bilibili-blue);
    text-decoration: none;
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    background: rgba(0, 161, 214, 0.08);
    transition: var(--transition-fast);
    font-weight: 500;
}

.example-link:hover {
    background: rgba(0, 161, 214, 0.15);
    transform: translateY(-2px);
}

/* ================ 加载动画 ================ */
.loading-section {
    text-align: center;
    padding: 60px 40px;
}

.loading-animation {
    margin-bottom: 40px;
}

.bilibili-loading {
    position: relative;
    display: inline-block;
}

.loading-tv {
    font-size: 80px;
    color: var(--bilibili-pink);
    animation: tvPulse 2s ease-in-out infinite;
}

@keyframes tvPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.loading-wave {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: 120px;
    margin: -60px 0 0 -60px;
    border: 4px solid var(--bilibili-blue);
    border-radius: 50%;
    opacity: 0;
    animation: wave 2s ease-out infinite;
}

@keyframes wave {
    from {
        transform: scale(0.5);
        opacity: 1;
    }
    to {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* 进度条 */
.progress-container {
    margin: 30px auto;
    max-width: 600px;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: var(--bg-light);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--bilibili-blue), var(--bilibili-pink));
    border-radius: 10px;
    width: 0%;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    margin-top: 12px;
    font-size: 18px;
    font-weight: 600;
    color: var(--bilibili-blue);
}

.loading-text {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 20px 0 10px;
}

.loading-subtext {
    font-size: 15px;
    color: var(--text-secondary);
}

/* 步骤指示器 */
.steps-indicator {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 50px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    opacity: 0.4;
    transition: var(--transition);
}

.step.active {
    opacity: 1;
}

.step.completed {
    opacity: 0.7;
}

.step-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-light);
    transition: var(--transition);
}

.step.active .step-icon {
    background: linear-gradient(135deg, var(--bilibili-blue), var(--bilibili-pink));
    color: white;
    box-shadow: var(--shadow-md);
    animation: pulse 1.5s ease-in-out infinite;
}

.step.completed .step-icon {
    background: var(--success-color);
    color: white;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.step-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.step.active .step-label {
    color: var(--bilibili-blue);
    font-weight: 600;
}

/* ================ 视频卡片 ================ */
.video-card {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(135deg, rgba(0, 161, 214, 0.05), rgba(251, 114, 153, 0.05));
    border-radius: var(--radius-lg);
    border: 2px solid rgba(0, 161, 214, 0.1);
}

.video-cover {
    position: relative;
    flex-shrink: 0;
    width: 320px;
    height: 200px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.video-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.video-cover:hover img {
    transform: scale(1.02);
    filter: brightness(0.95);
}

.video-badges {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.badge {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.badge-subtitle {
    background: rgba(0, 161, 214, 0.9);
    color: white;
}

.badge-frames {
    background: rgba(251, 114, 153, 0.9);
    color: white;
}

.video-details {
    flex: 1;
}

.video-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
    line-height: 1.4;
    cursor: pointer;
    transition: var(--transition);
    display: inline-block;
    position: relative;
}

.video-title:hover {
    color: var(--bilibili-blue);
    transform: translateX(5px);
}

.video-title::after {
    content: '🔗';
    position: absolute;
    right: -25px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: var(--transition);
    font-size: 18px;
}

.video-title:hover::after {
    opacity: 1;
    right: -30px;
}

.video-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 16px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: var(--text-secondary);
}

.meta-item i {
    color: var(--bilibili-blue);
    font-size: 16px;
}

.video-stats {
    display: flex;
    gap: 24px;
    padding-top: 16px;
    border-top: 2px solid rgba(0, 161, 214, 0.1);
}

.stat-item {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-item i {
    color: var(--bilibili-pink);
}

.stat-item strong {
    color: var(--bilibili-blue);
    font-size: 16px;
}

/* ================ 标签页 ================ */
.tabs-wrapper {
    margin-bottom: 30px;
}

.tabs {
    display: flex;
    gap: 0;
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    padding: 6px;
}

.tab-btn {
    flex: 1;
    padding: 16px 24px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.tab-btn:hover {
    color: var(--bilibili-blue);
    background: rgba(0, 161, 214, 0.08);
}

.tab-btn.active {
    color: white;
    background: linear-gradient(135deg, var(--bilibili-blue), var(--bilibili-pink));
    box-shadow: var(--shadow-sm);
}

.tab-btn i {
    font-size: 18px;
}

/* ================ 标签页内容 ================ */
.tab-content {
    min-height: 500px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-card {
    padding: 40px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--border-color);
}

/* Markdown内容样式 */
.markdown-content {
    line-height: 1.8;
    font-size: 16px;
    color: var(--text-primary);
}

.markdown-content h1 {
    font-size: 32px;
    font-weight: 700;
    margin: 30px 0 20px;
    padding-bottom: 16px;
    border-bottom: 3px solid var(--bilibili-blue);
    color: var(--text-primary);
}

.markdown-content h2 {
    font-size: 26px;
    font-weight: 700;
    margin: 28px 0 16px;
    color: var(--bilibili-blue);
    display: flex;
    align-items: center;
    gap: 12px;
}

.markdown-content h3 {
    font-size: 22px;
    font-weight: 600;
    margin: 24px 0 14px;
    color: var(--text-primary);
}

.markdown-content h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 20px 0 12px;
    color: var(--bilibili-pink);
}

.markdown-content p {
    margin-bottom: 16px;
    line-height: 1.8;
}

.markdown-content ul, .markdown-content ol {
    margin-left: 32px;
    margin-bottom: 16px;
}

.markdown-content li {
    margin-bottom: 10px;
    line-height: 1.7;
}

.markdown-content strong {
    font-weight: 700;
    color: var(--text-primary);
}

.markdown-content code {
    padding: 3px 8px;
    background: rgba(0, 161, 214, 0.08);
    border-radius: 4px;
    font-family: 'Courier New', Consolas, Monaco, monospace;
    font-size: 14px;
    color: var(--bilibili-pink);
}

.markdown-content pre {
    background: var(--bg-light);
    padding: 20px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 20px 0;
    border-left: 4px solid var(--bilibili-blue);
}

.markdown-content blockquote {
    border-left: 4px solid var(--bilibili-blue);
    padding-left: 20px;
    margin: 20px 0;
    color: var(--text-secondary);
    font-style: italic;
    background: rgba(0, 161, 214, 0.05);
    padding: 16px 20px;
    border-radius: var(--radius-sm);
}

.markdown-content hr {
    border: none;
    border-top: 2px solid var(--border-color);
    margin: 30px 0;
}

/* ================ 操作按钮 ================ */
.action-buttons {
    display: flex;
    gap: 20px;
    margin-top: 40px;
    justify-content: center;
}

.action-btn {
    padding: 14px 32px;
    background: white;
    border: 2px solid var(--bilibili-blue);
    color: var(--bilibili-blue);
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
}

.action-btn:hover {
    background: var(--bilibili-blue);
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.action-btn.primary {
    background: linear-gradient(135deg, var(--bilibili-blue), var(--bilibili-pink));
    border: none;
    color: white;
}

.action-btn.primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-lg);
}

/* ================ 错误区域 ================ */
.error-section {
    text-align: center;
    padding: 80px 40px;
}

.error-card i {
    font-size: 80px;
    color: var(--error-color);
    margin-bottom: 24px;
}

.error-card h3 {
    font-size: 28px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.error-card p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 30px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.retry-btn {
    padding: 14px 36px;
    background: var(--bilibili-blue);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.retry-btn:hover {
    background: var(--bilibili-blue-darker);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* ================ Toast提示 ================ */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 16px 24px;
    background: white;
    color: var(--text-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid var(--bilibili-blue);
    min-width: 250px;
}

.toast-icon {
    font-size: 20px;
}

.toast.success {
    border-left-color: var(--success-color);
}

.toast.success .toast-icon::before {
    content: '✓';
    color: var(--success-color);
}

.toast.error {
    border-left-color: var(--error-color);
}

.toast.error .toast-icon::before {
    content: '✗';
    color: var(--error-color);
}

.toast.info .toast-icon::before {
    content: 'ℹ';
    color: var(--bilibili-blue);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ================ 页脚 ================ */
.footer {
    text-align: center;
    padding: 24px;
    color: white;
    font-size: 15px;
    opacity: 0.9;
}

.footer a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    transition: var(--transition-fast);
}

.footer a:hover {
    border-bottom-color: white;
}

.footer i {
    color: var(--bilibili-pink);
    animation: heartbeat 1.5s ease infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.2); }
}

/* ================ 工具类 ================ */
.hidden {
    display: none !important;
}

/* ================ 响应式设计 ================ */
@media (max-width: 1024px) {
    .main-content {
        padding: 40px 30px;
    }
    
    .video-card {
        flex-direction: column;
    }
    
    .video-cover {
        width: 100%;
        max-width: 100%;
    }
    
    .steps-indicator {
        gap: 20px;
    }
    
    .step-label {
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .main-content {
        padding: 24px 16px;
        border-radius: var(--radius-md);
    }
    
    .logo h1 {
        font-size: 28px;
    }
    
    .bilibili-logo {
        width: 48px;
        height: 48px;
    }
    
    .subtitle {
        font-size: 14px;
    }
    
    .input-container {
        flex-direction: column;
    }
    
    .analyze-btn {
        width: 100%;
        justify-content: center;
    }
    
    .example-links {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .tabs {
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px;
    }
    
    .tab-btn {
        flex: 1 1 calc(50% - 4px);
        font-size: 14px;
        padding: 12px 16px;
    }
    
    .tab-btn span {
        display: none;
    }
    
    .content-card {
        padding: 24px 16px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
    
    .steps-indicator {
        gap: 12px;
    }
    
    .step-icon {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }
    
    .step-label {
        font-size: 11px;
    }
}

/* ================ 新增功能样式 ================ */

/* 输入操作区域 */
.input-actions {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.batch-btn {
    padding: 20px 32px;
    background: linear-gradient(135deg, var(--bilibili-pink), var(--warning-color));
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    box-shadow: var(--shadow-md);
}

.batch-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.batch-btn:active {
    transform: translateY(-1px);
}

/* 推荐视频区域 */
.recommendations-section {
    margin: 30px 0;
    padding: 25px;
    background: linear-gradient(135deg, rgba(0, 161, 214, 0.03), rgba(251, 114, 153, 0.05));
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 161, 214, 0.1);
    animation: fadeIn 0.5s ease;
}

.recommendations-section h3 {
    color: var(--bilibili-blue);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3em;
    font-weight: 600;
}

.recommendation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.recommendation-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.recommendation-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--bilibili-blue);
}

.recommendation-thumbnail-wrapper {
    position: relative;
    width: 100%;
    height: 160px;
    overflow: hidden;
    background: var(--bg-light);
}

.recommendation-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.recommendation-card:hover .recommendation-thumbnail {
    transform: scale(1.05);
}

.recommendation-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    backdrop-filter: blur(4px);
}

.recommendation-info {
    padding: 16px;
}

.recommendation-title {
    font-weight: 600;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    color: var(--text-primary);
    font-size: 15px;
    transition: color 0.2s ease;
    text-decoration: none;
}

.recommendation-title:hover {
    color: var(--bilibili-blue);
}

.recommendation-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.recommendation-author {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recommendation-author i {
    color: var(--bilibili-blue);
    font-size: 12px;
    flex-shrink: 0;
}

.recommendation-stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
}

.stat-item i {
    font-size: 11px;
    color: var(--bilibili-pink);
}

/* 推荐视频操作按钮 */
.recommendation-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition);
}

.recommendation-card:hover .recommendation-actions {
    opacity: 1;
    transform: translateY(0);
}

.rec-action-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    position: relative;
    overflow: hidden;
}

.rec-action-btn i {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.rec-action-btn span {
    font-size: 12px;
    font-weight: 600;
}

.rec-action-btn.analyze-btn {
    color: var(--bilibili-blue);
    border-color: rgba(0, 161, 214, 0.3);
}

.rec-action-btn.analyze-btn:hover {
    background: linear-gradient(135deg, var(--bilibili-blue), var(--bilibili-blue-dark));
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 161, 214, 0.3);
    border-color: var(--bilibili-blue);
}

.rec-action-btn.analyze-btn:hover i {
    transform: scale(1.1);
}

.rec-action-btn.watch-btn {
    color: var(--bilibili-pink);
    border-color: rgba(251, 114, 153, 0.3);
}

.rec-action-btn.watch-btn:hover {
    background: linear-gradient(135deg, var(--bilibili-pink), #ff8cb8);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(251, 114, 153, 0.3);
    border-color: var(--bilibili-pink);
}

.rec-action-btn.watch-btn:hover i {
    transform: scale(1.1);
}

/* 右键菜单样式 */
.context-menu-item {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 12px;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.context-menu-item:hover {
    background: var(--bg-light);
    color: var(--bilibili-blue);
}

.context-menu-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.context-menu-item.analyze-item i {
    color: var(--bilibili-blue);
}

.context-menu-item.watch-item i {
    color: var(--bilibili-pink);
}

.context-menu-item.copy-item i {
    color: var(--success-color);
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 0;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(0, 161, 214, 0.05), rgba(251, 114, 153, 0.05));
}

.modal-header h3 {
    font-size: 1.5em;
    color: var(--text-primary);
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.2em;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: var(--bg-light);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding: 20px 30px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-light);
}

#batchInput {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1em;
    line-height: 1.5;
    resize: vertical;
    font-family: inherit;
    transition: var(--transition);
}

#batchInput:focus {
    outline: none;
    border-color: var(--bilibili-blue);
    box-shadow: 0 0 0 3px rgba(0, 161, 214, 0.1);
}

.btn-cancel, .btn-primary {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-cancel {
    background: var(--bg-light);
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
}

.btn-cancel:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.btn-primary {
    background: linear-gradient(135deg, var(--bilibili-blue), var(--bilibili-pink));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ================ B站登录功能样式 ================ */

/* 登录状态显示 */
.login-status {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
}

.login-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
}

.login-info i {
    font-size: 18px;
    color: var(--bilibili-pink);
}

.login-actions {
    display: flex;
    gap: 10px;
}

.login-btn, .logout-btn {
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(5px);
}

.login-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.logout-btn:hover {
    background: rgba(255, 107, 107, 0.2);
    border-color: rgba(255, 107, 107, 0.5);
    transform: translateY(-2px);
}

.login-btn i {
    color: var(--bilibili-blue);
}

.logout-btn i {
    color: var(--error-color);
}

/* 登录模态框样式 */
.login-modal-content {
    max-width: 450px;
    text-align: center;
}

.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    min-height: 320px;
    justify-content: center;
}

/* 二维码区域 */
.qr-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.qr-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 40px;
    color: var(--text-secondary);
}

.qr-placeholder i {
    color: var(--bilibili-blue);
    opacity: 0.6;
}

.qr-code {
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.qr-code img {
    width: 220px;
    height: 220px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-md);
    background: white;
}

.login-tips {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

.login-tips p {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-tips i {
    color: var(--info-color);
}

.small-text {
    font-size: 12px !important;
    opacity: 0.8;
}

/* 登录状态显示 */
.login-status-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 40px 20px;
}

.status-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(0, 161, 214, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bilibili-blue);
    font-size: 24px;
}

.status-icon .fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.status-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* 登录成功状态 */
.login-success-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 40px 20px;
    animation: fadeIn 0.5s ease;
}

.success-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(82, 196, 26, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--success-color);
    font-size: 28px;
}

.success-text p {
    margin: 5px 0;
    color: var(--text-primary);
    font-weight: 600;
}

/* 刷新按钮 */
.btn-refresh {
    padding: 12px 24px;
    background: var(--bg-light);
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-refresh:hover {
    background: var(--bilibili-blue);
    color: white;
    border-color: var(--bilibili-blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-refresh:active {
    transform: translateY(0);
}

/* 登录状态动画 */
.login-status.logged-in {
    background: rgba(82, 196, 26, 0.15);
    border-color: rgba(82, 196, 26, 0.3);
}

.login-status.logged-in .login-info i {
    color: var(--success-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .login-status {
        position: static;
        margin-top: 20px;
        justify-content: center;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.15);
    }

    .login-info, .login-actions {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .login-btn, .logout-btn {
        font-size: 12px;
        padding: 6px 12px;
    }

    .login-modal-content {
        max-width: 95%;
        margin: 10px;
    }

    .qr-code img {
        width: 180px;
        height: 180px;
    }

    .login-container {
        min-height: 280px;
        gap: 20px;
    }

    .qr-placeholder {
        padding: 30px 20px;
    }

    .modal-header, .modal-body, .modal-footer {
        padding: 20px 16px;
    }
}

/* 响应式优化 */
@media (max-width: 768px) {
    .input-actions {
        flex-direction: column;
    }

    .batch-btn {
        justify-content: center;
    }

    .recommendation-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 20px;
    }

    .modal-header, .modal-body, .modal-footer {
        padding: 20px;
    }
}

/* ================ 词云图样式 ================ */
.wordcloud-section {
    margin-top: 30px;
    padding: 25px;
    background: linear-gradient(135deg, rgba(0, 161, 214, 0.02), rgba(251, 114, 153, 0.03));
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 161, 214, 0.08);
    animation: fadeIn 0.5s ease;
}

.wordcloud-section h4 {
    color: var(--bilibili-blue);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2em;
    font-weight: 600;
}

.wordcloud-container {
    position: relative;
    background: white;
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

#wordcloudCanvas {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    cursor: crosshair;
    transition: var(--transition);
}

#wordcloudCanvas:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

.wordcloud-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.9);
    padding: 30px;
    border-radius: var(--radius-md);
    backdrop-filter: blur(5px);
}

.wordcloud-loading i {
    font-size: 32px;
    color: var(--bilibili-blue);
    animation: pulse 1.5s ease-in-out infinite;
}

.wordcloud-controls {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    justify-content: center;
}

.wordcloud-btn {
    padding: 10px 20px;
    background: white;
    border: 2px solid var(--bilibili-blue);
    color: var(--bilibili-blue);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

.wordcloud-btn:hover {
    background: var(--bilibili-blue);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.wordcloud-btn:active {
    transform: translateY(0);
}

.wordcloud-btn i {
    font-size: 16px;
}

/* 词云提示信息 */
.wordcloud-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s ease;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.wordcloud-tooltip.visible {
    opacity: 1;
}

/* 词云统计信息 */
.wordcloud-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.wordcloud-stat {
    text-align: center;
}

.wordcloud-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--bilibili-blue);
    display: block;
}

.wordcloud-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* 响应式词云设计 */
@media (max-width: 768px) {
    .wordcloud-section {
        margin-top: 20px;
        padding: 20px 16px;
    }

    .wordcloud-container {
        padding: 15px 10px;
    }

    #wordcloudCanvas {
        width: 100% !important;
        height: 300px !important;
    }

    .wordcloud-controls {
        flex-direction: column;
        gap: 8px;
    }

    .wordcloud-btn {
        width: 100%;
        justify-content: center;
    }

    .wordcloud-stats {
        flex-direction: column;
        gap: 12px;
    }

    .wordcloud-stat {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }

    .wordcloud-stat-value {
        font-size: 20px;
    }
}
